<template>
	<view class="content">
		<view class="top-content">
			<!-- <image class="canzheng-bgc" src="../../static/images/zhishuo/canzheng-bgc.png"></image> -->
			<customNavbar title="党员年度得分详情"></customNavbar>
			<view class="top-info">
				<view class="top-big-title">党员年度得分详情</view>
				<view class="canzheng-area-content">
					<view class="canzheng-area">地区 高新四支部</view>
					<view class="canzheng-year">时间 {{timeYear}}年</view>
				</view>
			</view>
			<view class="selectCom">
				<uni-data-select v-model="selectYear" :localdata="rangeYears" @change="change" :clear="false">

				</uni-data-select>
			</view>

	
		<view class="detail-content">
			<view class="detail-top">
				<view class="name">姓名</view>
				<view class="djbh">党籍编号</view>
				<view class="df">得分</view>
			</view>
			<view class="detail-list" v-for="item in dangYuanDatas" :key="item.name">
				<view class="detail-list-type">{{item.name}}</view>
				<view class="no">{{item.no}}</view>
				<view class="score">{{item.score}}</view>
			
			</view>
			
	
			
		</view>
			



		</view>
	</view>
</template>

<script>
	import customNavbar from '../../components/customNavbar/customNavbar.vue'
	import {
		partyMemberHomeScoreList
	} from '../../api/index.js'

	export default {
		components: {
			customNavbar
		},
		data() {
			return {
				timeYear: '',
				handlerLoading: false,
				selectYear: 3,
				rangeYears: [],
				dangYuanDatas: '',
				num: ''
			}
		},
		onShow() {
			this.getDYDF()
	
	

		},
		onLoad() {
			this.timeYear = this.$store.state.year
			this.rangeYears = this.$store.state.rangeYears
			for (let item of this.rangeYears) {
				if (this.timeYear.toString()  === item.text.slice(0, -1)) {
					this.selectYear = item.value
				}
			}

		},
		methods: {
			change(e) {
				for (let item of this.rangeYears) {
					if (e === item.value) {
						this.timeYear = item.text.slice(0, -1)
					}
				}
				this.getDYDF()
			},
			getDYDF() {
				this.handlerLoading = true
				partyMemberHomeScoreList({
					year: this.timeYear
				}).then(res => {
					console.log(res);
					if (res.errors.length > 0) {
						uni.showToast({
							title: res.errors,
							icon: 'none',
							duration: 2000,
						});
					} else {

						this.dangYuanDatas = res.scores
					



					}

				}).catch(err => {
					this.$common.errorToShow(err)
					this.handlerLoading = false;
				})
			},




		

		},

	}
</script>

<style lang="scss" scoped>
	::v-deep .uni-select {
	height: 60rpx;
	border: 0;
	background-color: #ffffff;
	}



	.content {
		height: 100%;
		width: 100%;
		background-color: #F9F9F9;

		.top-content {
			background-image: url('');
			width: 100%;
			height: vw(420);
			background-size: cover;

			.top-info {
				padding: vw(16) vw(0) vw(0) vw(36);

				.top-big-title {
					font-size: 32px;
					font-weight: bold;
					text-align: left;
					color: #ffffff;
				}

				.canzheng-area-content {
					display: flex;
					margin-top: vw(10);
					.canzheng-area {
						font-size: vw(24);
						font-family: PingFang SC, PingFang SC-Regular;
						font-weight: Regular;
						text-align: left;
						color: #ffffff;
						margin-right: vw(40);

					}

					.canzheng-year {
						font-size: vw(24);
						font-family: PingFang SC, PingFang SC-Regular;
						font-weight: Regular;
						text-align: left;
						color: #ffffff;
					}
				}
			}

			.selectCom {	
				width: vw(160);
				margin: vw(20) vw(0) vw(0) vw(32);
			}

		.detail-content {
			width: vw(686);
			background-color: #ffffff;
			margin: 0 auto;
		
			.detail-top {
				width: vw(686);
				height: vw(80);
				background: #d6efff;
				border-radius:8px 8px 0 0;
				box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.03); 
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin: vw(40) auto vw(20);
				
		
				.name {
		
					font-size: vw(28);
					font-family: PingFang SC, PingFang SC-Semibold;
					font-weight: bold;
					text-align: left;
					color: #3397ff;
					margin-left: vw(20);
		
				}
				.djbh {
					font-size: vw(28);
					font-family: PingFang SC, PingFang SC-Semibold;
					font-weight: bold;
					text-align: left;
					color: #3397ff;
				
						
				}
		
				.df {
					font-size: vw(28);
					font-family: PingFang SC, PingFang SC-Semibold;
					font-weight: bold;
					text-align: left;
					color: #3397ff;
					margin-right: vw(20);
		
				}
			}
		
			.detail-list {
				line-height: 2.5;
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin:  0 vw(20);
				.detail-list-type {
					font-size: vw(28);
					font-family: PingFang SC, PingFang SC-Regular;
					font-weight: Regular;
					text-align: left;
					color: #333333;
				
					min-width: 50px;
		
		
				}
		
				.no {
		
					font-size: vw(28);
					font-family: PingFang SC, PingFang SC-Regular;
					font-weight: Regular;
					text-align: left;
					color: #333333;
		
					min-width: 91px;
					
		
				}
		
				.score {
		
					font-size: vw(28);
					font-family: PingFang SC, PingFang SC-Regular;
					font-weight: Regular;
					text-align: right;
					color: #333333;
					min-width: 20px;
		
	
				}
				
			}
		}

	
		}
	}
</style>
